# def print_file_info(file_name):
#   try:
#     k = None
#     k = open(file_name,'r',encoding='UTF-8')
#     content = k.read()
#     print(content)
#   except Exception as e:
#     print(e)
#   finally:
#     if k:
#       k.close()

# print_file_info('d:\\kankannide.txt')

# def append_to_file(file_name,data):
#   l =  open(file_name, 'a', encoding='UTF-8')
#   l.write(data + '\n')
#   l.close()

# append_to_file('d:\\kankanwode.txt','今天是个好日子')
__all__ = ['print_file_info']  
  
def print_file_info(file_name):  
  try:  
    with open(file_name, 'r', encoding='UTF-8') as k:  
      content = k.read()  
      print(content)  
  except Exception as e:  
    print(e)  
  
print_file_info('d:\\ihao.txt')  
  
def append_to_file(file_name, data):  
  with open(file_name, 'a', encoding='UTF-8') as l:  
    l.write(data + '\n')
  
append_to_file('d:\\ihaoma.txt', 'kannannide')